import logging
from datetime import date, timedelta
from decimal import Decimal
from typing import Any, Literal, LiteralString

from auditlog.models import AuditlogHistoryField
from auditlog.registry import auditlog
from django.contrib import admin
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import F
from django.utils import timezone
from django.utils.html import format_html
from django.utils.safestring import SafeText

from customauth.models import MyUser


class Base(models.Model):
    create_at = models.DateTimeField(default=timezone.now)
    update_at = models.DateTimeField(auto_now=True)
    history = AuditlogHistoryField()

    class Meta:
        abstract = True


class Example(Base):
    name = models.CharField(max_length=100)

    def __str__(self) -> str:
        return self.name

